const os = require('os')
const netInfo = os.networkInterfaces()

let ipAddr;
if (os.type() == 'Windows_NT') {
    for (const k in netInfo) {
        for (const item of netInfo[k]) {
            if (item.family == 'IPv4' && !item.internal) ipAddr = item.address
        }
    }
}

module.exports = ipAddr